#pragma once

#include "Utils.h"
#include "Type.h"
#include <type_traits>
#include <iostream>

namespace Smo
{
	using namespace std;

	class BaseObject
	{
	protected:
		Type mType;	

	public:
		SMO_GETTER_FOR_CONSTREF(Type, Type);

		virtual wstring ToString() const
		{
			auto str = typeid(*this).name();
			return Convert::ToString(str);
		}

		virtual void Write(wostream& stream) const
		{
			stream << this->ToString();
		}

		virtual ~BaseObject() { }
	};
}

using namespace Smo;
using namespace std;

wostream& operator<<(wostream& stream, const BaseObject& obj)
{
	obj.Write(stream);
	return stream;
}

wostream& operator<<(wostream& stream, const BaseObject* obj)
{
	obj->Write(stream);
	return stream;
}